<form method="post" enctype="multipart/form-data" target="_blank" id="form-order">
    <div class="table-responsive">
        <volist name="orderList" id="group">
            <div style="border-bottom: 1px solid #333">
                <div class="panel">
                    <div class="panel-heading">
                        <table class="table table-bordered table-hover">
                            <tr>
                                <td>团购活动</td>
                                <td>
                                    标题： {$group.title}<br>
                                    商品：{$group.goods_name}
                                </td>
                                <td align="center">操作</td>
                            </tr>
                            <tr>
                                <td>参团人数</td>
                                <td>
                                    {$group.member_num} / {$group.per_num}
                                </td>
                                <td rowspan="3">
                                    <switch name="group.status">
                                        <case value="0" break="0">
                                            <a class="btn btn-danger btn-ajax" data-title="确定要解散此团购吗？" data-url="{:U('Order/destory_group',['group_info_id'=>$group['group_info_id']])}">一键解散</a>
                                        </case>
                                        <case value="1">

                                        </case>
                                        <case value="2">

                                        </case>
                                    </switch>
                                </td>
                            </tr>
                            <tr>
                                <td>团购状态</td>
                                <td>
                                    {$group.status_desc}
                                </td>
                            </tr>
                            <tr>
                                <td>店铺</td>
                                <td>
                                    <img style="height:40px;width:40px" src="{$group.shop.shop_head_img}" />
                                    <p>{$group.shop.shop_name}</p>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <table class="table table-bordered table-hover" style="font-size:12px;">
                    <thead>
                        <tr>
                            <td style="width: 1px;" class="text-center">
                                <!-- <input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);"> -->
                                序号
                            </td>
                            <td class="text-center">
                                <a href="javascript:sort('order_sn');">订单编号</a>
                            </td>
                            <td class="text-center">
                                <a href="javascript:sort('consignee');">收货人</a>
                            </td>
                            <td class="text-center">
                                <a href="">总金额</a>
                            </td>
                            <td class="text-center">
                                <a href="">应付金额</a>
                            </td>
                            <td class="text-center">
                                <a href="javascript:sort('order_status');">订单状态</a>
                            </td>
                            <td class="text-center">支付状态</td>
                            <td class="text-center">发货状态</td>
                            <td class="text-center">支付方式</td>
                            <td class="text-center">配送方式</td>
                            <td class="text-center">
                                <!-- <a href="javascript:sort('add_time');">下单时间</a> -->
                                参团时间
                            </td>
                            <td class="text-center">操作</td>
                        </tr>
                    </thead>
                    <tbody>
                        <volist name="group.order_list" id="list">
                            <tr>
                                <td class="text-center">
                                    <!-- <input type="checkbox" name="selected[]" value="6">
                                <input type="hidden" name="shipping_code[]" value="flat.flat"> -->
                                    {$i}
                                </td>
                                <td class="text-center">{$list.order_sn}</td>
                                <td class="text-center">{$list.consignee}:{$list.mobile}</td>
                                <td class="text-center">{$list.goods_price}</td>
                                <td class="text-center">{$list.order_amount}</td>
                                <td class="text-center">{$order_status[$list[order_status]]}<if condition="$list['is_cod'] eq '1'"><span
                                            style="color: red">(货到付款)</span></if>
                                </td>
                                <td class="text-center">{$pay_status[$list[pay_status]]}</td>
                                <td class="text-center">{$shipping_status[$list[shipping_status]]}</td>
                                <td class="text-center">{$list.pay_name|default='其他方式'}</td>
                                <td class="text-center">{$list.shipping_name}</td>
                                <!-- <td class="text-center">{$list.add_time|date='Y-m-d H:i',###}</td> -->
                                <td class="text-center">{$list.join_group_time|date='Y-m-d H:i',###}</td>
                                <td class="text-center">
                                    <a href="{:U('Admin/order/detail',array('order_id'=>$list['order_id']))}"
                                        data-toggle="tooltip" title="" class="btn btn-info" data-original-title="查看详情"><i
                                            class="fa fa-eye"></i></a>
                                    <if condition="($list['order_status'] eq 3) or ($list['order_status'] eq 5)">
                                        <!-- <a href="{:U('Admin/order/delete_order',array('order_id'=>$list['order_id']))}" data-toggle="tooltip" class="btn btn-danger" title="删除"><i class="fa fa-trash-o"></i></a> -->
                                        <else />
                                        <!-- <a href="javascript:void(0)" onclick="alert('该订单不得删除')" data-toggle="tooltip" class="btn btn-default" title="删除"><i class="fa fa-trash-o"></i></a> -->
                                    </if>
                                </td>
                            </tr>
                        </volist>
                    </tbody>
                </table>
            </div>
        </volist>
    </div>
</form>
<div class="row">
    <div class="col-sm-6 text-left"></div>
    <div class="col-sm-6 text-right">{$page}</div>
</div>
<script>
    $(".btn-ajax").on("click", function () {

        var title = $(this).data("title");
        var url = $(this).data("url");
        if (title && title != '') {
            layer.confirm(title, function (confirm) {

                if (confirm > 0) {
                    layer.msg("正在处理", {
                        time: 0
                    });
                    $.ajax({
                        url: url,
                        type: "get",
                        dataType: "json",
                        success: function (res) {
                            layer.msg(res.msg || res.info || "未知错误")
                        }
                    })
                }

            })
        } else {
            var url = $(this).data("url");
            $.ajax({
                url: url,

            })
        }
    })

    $(".pagination  a").click(function () {
        var page = $(this).data('p');
        ajax_get_table('search-form2', page);
    });

    $(function () {
        $("[data-toggle='tooltip']").tooltip();
    })
</script>